<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    li{
      height: 50px;
      width: 200px;
      background-color: rgba(161, 190, 29, 0.657);
      margin-top: 10px;
    }
  </style>
</head>
<body>
  <div id="app">
    <button @click="add">动态添加一个数据</button>
    <div v-if="isShow">
      <button @click="changeMsg">点击修改msg</button>
      {{msg}}
    </div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        isShow: false
      },
      methods: {
        add(){
          this.msg = '这是动态添加的数据';
          this.isShow = true;
        },
        changeMsg(){
          this.msg = '值改变了';
        }
      }
    })
  </script>
</body>
</html>